<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" content="">
		<title>svg - svg:line</title>
		<style type="text/css">
		</style>
		<script type="text/javascript" src="../../d3.js"></script>
	</head>
	<body>
		<script type="text/javascript">
			var svg = d3.select('body')
				.append('svg')	//向body标签增加svg子元素
				.attr({
					"width": 700,
					"height": 500,
				});

			svg.append('line')
				.attr({
					//line起点坐标：(100,100)
					"x1": 100, "y1": 100,
					//line终点坐标：(200,200)
					"x2": 200, "y2": 200,
				})
				.style({
					//line颜色：indigo
					"stroke": "indigo",
					//line粗细：5
					"stroke-width": 5
				});
		</script>
	</body>
</html>